using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace UM_Model.Models.Mapping
{
    public class AdvertisMap : EntityTypeConfiguration<Advertis>
    {
        public AdvertisMap()
        {
            // Primary Key
            this.HasKey(t => t.AdvertiseID);

            // Properties
            this.Property(t => t.Image)
                .HasMaxLength(200);

            this.Property(t => t.Link)
                .HasMaxLength(200);

            // Table & Column Mappings
            this.ToTable("Advertises");
            this.Property(t => t.AdvertiseID).HasColumnName("AdvertiseID");
            this.Property(t => t.Image).HasColumnName("Image");
            this.Property(t => t.Link).HasColumnName("Link");
            this.Property(t => t.IsTop).HasColumnName("IsTop");
            this.Property(t => t.IsEnable).HasColumnName("IsEnable");
        }
    }
}
